const https = require('https')
const cheerio = require('cheerio')
// https://movie.douban.com/explore
// https://www.itcast.cn/newsvideo/newslist.html
// https://www.itcast.cn/news/json/f1f5ccee-1158-49a6-b7c4-f0bf40d5161a.json

// let url = 'https://www.itcast.cn/news/json/f1f5ccee-1158-49a6-b7c4-f0bf40d5161a.json'
let url = 'https://movie.douban.com/subject/35453251/'
// 创建请求对象
let req = https.request(url,{ method: 'get' },res=>{
    let chunks = []
    res.on('data',chunk => chunks.push(chunk))

    res.on('end',()=>{
        let result = Buffer.concat(chunks).toString('utf-8')
        // console.log(JSON.parse(result).data)
        console.log(result)
    })
})

// 发送请求
req.end()